<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .box {
            width: 400px;
            height: 400px;
            background: #eee;
            overflow: hidden;
        }

        .div1 {
            width: 50px;
            height: 50px;
            background: pink;
            /* margin-bottom: 10px; */
            margin-top: 20px;
            /* position: absolute; */
        }

        .gap {
            height: 10px;
        }

        .div2 {
            width: 50px;
            height: 50px;
            background: skyblue;
            margin-top: 20px;
        }
    </style>
</head>

<body>
    <div class="box">
        <div class="div1"></div>
        <div class="gap"></div>
        <div class="div2"></div>
    </div>
</body>

</html>